﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmFamilyService.h"
#include "IFamilyGeneralForm.h"


namespace gfam
{

    class IFamily2DSketchCurve;
    class IFamily2DSketchLine;
    class IFamilySketch2D;

    /// \brief 旋转体
    class GM_FAMILY_SERVICE_EXPORT IFamilyRevolution : public IFamilyGeneralForm
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyRevolution, gfam::IFamilyGeneralForm)

    public:
        /// \brief 创建旋转体
        /// 
        /// \param pDocument 文档
        /// \param sketchId 草图id
        /// \param startAngle 起始角度
        /// \param endAngle 终止角度
        /// \return 旋转体
        static IFamilyRevolution* Create(gcmp::IDocument* pDocument, const gcmp::ElementId& sketchId, double startAngle, double endAngle);

        /// \brief 获取底面定位线
        /// 
        /// \return 底面定位线
        virtual const IFamily2DSketchLine* GetBottomLocationLine() const = 0;

        /// \brief 获取顶面定位线
        /// 
        /// \return 顶面定位线
        virtual const IFamily2DSketchLine* GetTopLocationLine() const = 0;

        /// \brief 获取轴线
        /// 
        /// \return 轴线
        virtual const IFamily2DSketchLine* GetAxisLine() const = 0;

        /// \brief 获取轴线
        /// 
        /// \return 轴线
        virtual IFamily2DSketchLine* GetAxisLine() = 0;

        /// \brief 获取轮廓草图id
        /// 
        /// \return 轮廓草图id
        virtual gcmp::ElementId GetSketchId() const = 0;

        /// \brief 设置轮廓草图id
        /// 
        /// \param id 草图id
        virtual void SetSketchId(const gcmp::ElementId& id) = 0;

        /// \brief 获取起始角度
        /// 
        /// \return 起始角度
        virtual double GetStartAngle() const = 0;

        /// \brief 设置起始角度
        /// 
        /// \param  startAngle 起始角度
        virtual void SetStartAngle(double startAngle) = 0;

        /// \brief 获取终止角度
        /// 
        /// \return 终止角度
        virtual double GetEndAngle() const = 0;

        /// \brief 设置终止角度
        /// 
        /// \param  endAngle 终止角度
        virtual void SetEndAngle(double endAngle) = 0;

        /// \brief 获取端面草图id
        /// 
        /// \return 端面草图id
        virtual gcmp::ElementId GetEndfaceSketchId() const = 0;

        /// \brief 设置端面草图id
        /// 
        /// \param 草图id
        virtual void SetEndfaceSketchId(const gcmp::ElementId& id) = 0;

        /// \brief 获取端面草图
        /// 
        /// \return 端面草图
        virtual const IFamilySketch2D* GetEndfaceSketch() const = 0;

  
        /// \brief 获取轮廓草图
        /// 
        /// \return 轮廓草图
        virtual IFamilySketch2D*  GetSketch() = 0;

        /// \brief 获取轮廓草图
        /// 
        /// \return 轮廓草图
        virtual const IFamilySketch2D*  GetSketch() const = 0;


        /// \brief 更新中心面草图。（TODO 重命名接口）
        /// 
        /// \param pDocument 文档
        virtual void RegenerateCenterSketch(gcmp::IDocument* pDocument) = 0;
    };

}
